home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / graphics / wave / form1.frm (.txt) next >
Encoding:
Visual Basic Form  |  1995-06-06  |  2.8 KB  |  108 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    BackColor       =   &H00000000&
  4.    Caption         =   "WAVE-DEMO"
  5.    ClientHeight    =   3525
  6.    ClientLeft      =   1695
  7.    ClientTop       =   2850
  8.    ClientWidth     =   5625
  9.    Height          =   3930
  10.    Left            =   1635
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   3525
  13.    ScaleWidth      =   5625
  14.    Top             =   2505
  15.    Width           =   5745
  16.    Begin CommandButton Command3 
  17.       Caption         =   "60"
  18.       Height          =   375
  19.       Left            =   120
  20.       TabIndex        =   4
  21.       Top             =   3000
  22.       Width           =   975
  23.    End
  24.    Begin CommandButton Command2 
  25.       Caption         =   "180"
  26.       Height          =   375
  27.       Left            =   2280
  28.       TabIndex        =   3
  29.       Top             =   3000
  30.       Width           =   855
  31.    End
  32.    Begin PictureBox Picture1 
  33.       AutoRedraw      =   -1  'True
  34.       Height          =   1530
  35.       Left            =   360
  36.       Picture         =   FORM1.FRX:0000
  37.       ScaleHeight     =   1500
  38.       ScaleWidth      =   4305
  39.       TabIndex        =   2
  40.       Top             =   4200
  41.       Width           =   4335
  42.    End
  43.    Begin PictureBox Picture2 
  44.       BackColor       =   &H00000000&
  45.       Height          =   1815
  46.       Left            =   120
  47.       ScaleHeight     =   1785
  48.       ScaleWidth      =   4785
  49.       TabIndex        =   1
  50.       Top             =   480
  51.       Width           =   4815
  52.    End
  53.    Begin CommandButton Command1 
  54.       Caption         =   "90"
  55.       Height          =   375
  56.       Left            =   1200
  57.       TabIndex        =   0
  58.       Top             =   3000
  59.       Width           =   975
  60.    End
  61. Sub Command1_Click ()
  62. '90 parts
  63. cnt% = 90
  64. Call scroll
  65. End Sub
  66. Sub Command2_Click ()
  67. '180 parts
  68. cnt% = 180
  69. Call scroll
  70. End Sub
  71. Sub Command3_Click ()
  72. '60 parts
  73. cnt% = 60
  74. Call scroll
  75. End Sub
  76. Sub scroll ()
  77. form1.ScaleMode = 3
  78. picture1.ScaleMode = 3
  79. picture2.ScaleMode = 3
  80. 'relative height of sine-wave
  81. hh% = 5
  82. ' set up the sinewave
  83.     For n% = 1 To cnt%
  84.         wink(n%) = Sin(3.14159 / cnt% * n% * 360 / cnt%) * hh%
  85.     Next n%
  86. destheight = picture2.ScaleHeight
  87. faktx = picture1.ScaleWidth / cnt%
  88. destwidth% = faktx
  89. For kk% = 1 To 3
  90. 'for 3 times
  91.     For aa% = 1 To cnt%
  92.     'for all segments
  93.         For q% = 1 To cnt%
  94.             xdest = q% * faktx
  95.             temp = BitBlt(picture2.hDC, xdest, wink(q%), destwidth% + 1, destheight, picture1.hDC, xdest, 0, SRCCOPY)
  96.         Next q%
  97.     DoEvents
  98.     'now shift the sine-wave
  99.     tmp% = wink(cnt%)
  100.         For k% = 1 To cnt%
  101.             tmp1% = wink(k%)
  102.             wink(k%) = tmp%
  103.             tmp% = tmp1%
  104.         Next k%
  105.     Next aa%
  106. Next kk%
  107. End Sub
  108.